<%@page import="com.license.logic.pojo.User"%>
<%@ page contentType="text/html"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<f:view>
<html>
  <head>
    <title>Procardio</title>
    <!-- Bootstrap -->
    <link href="../bootstrap/css/bootstrap.css" rel="stylesheet" media="screen"/>
    <link href="../procardio/css/procardio.css" rel="stylesheet" media="screen"/>
    <script src="../bootstrap/js/bootstrap.js"></script>
    <script src="../procardio/js/procardio.js"></script>
    <script	src="../procardio/js/jquery-latest.js"></script>
    <script src="../bootstrap/js/bootstrap.min.js"></script>
      <link rel="stylesheet" href="../font-awesome/css/font-awesome.css">
    <script src="../jquery-1.8.1.min.js" type="text/javascript"></script>

    
    <style type="text/css">
        #line-chart {
            height:300px;
            width:800px;
            margin: 0px auto;
            margin-top: 1em;
        }
        .brand { font-family: georgia, serif; }
        .brand .first {
            color: #ccc;
            font-style: italic;
        }
        .brand .second {
            color: #fff;
            font-weight: bold;
        }
    </style>

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="../assets/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
  </head>
  <body>
    <div class="procardio_navbar">
	<div class="navbar">
		<div class="navbar-inner" id="procardio_navbar-inner">
		    <a class="procadio_brand" href="http://localhost:8082/procardio.web/faces/JSFfiles/LogInPage.jsp">Pro</a>
			<a class="brand" href="http://localhost:8082/procardio.web/faces/JSFfiles/LogInPage.jsp">Cardio</a>
			<div id="userStatus">
				<div class="procardio_btn_group">
					<div class="btn-group">
						<img class="procadio_avatar" src="../procardio/img/loginAvatar1.jpg" alt="user avatar"></img> 
							<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
							 <span class="caret"></span>
						    </a>
						<ul class="dropdown-menu">
							<%	User currentUser = (User) request.getSession().getAttribute("currentSessionUser");
								if (currentUser == null)
								{
									request.getSession().setAttribute("loginPageOperation", "login");
							%>
							<li><a href="http://localhost:8082/procardio.web/faces/JSFfiles/LogInPage.jsp">Log In</a></li>
							<%
								}
								else {
							%>
							<li><a href="http://localhost:8082/procardio.web/faces/JSFfiles/StartPage.jsp">Start Page</a></li>
							<li><a href="#" onclick="javascript:logout();" >Log Out </a></li>
							
							<% } %>
						</ul>
					</div>
				</div>
				
				<%	
					String userName = "Guest";
					String status = "Guest";
					String contact = "guest@domain.com";
					if (currentUser != null) {
						userName = currentUser.getName();
						status = currentUser.getAuthorization();
						contact = currentUser.getContact();
					}
				%>
				<div id="userStatusText">
					Name : <%=userName%>
					</br>
					Status : <%=status%>
					</br>
					Contact : <%=contact %>
				</div>
			</div>
		</div>
	</div>
	<div class="navbar">
		<div class="procardio_navbar-inner">
		 	<ul class="nav">
				<%	String start_page = "";
					String recomandation = "";
					String administration = "";
				if (currentUser != null) {
					start_page = "<li><a href=\"http://localhost:8082/procardio.web/faces/JSFfiles/StartPage.jsp\">Home</a></li>";
					recomandation = "<li><a class=\"divider-vertical\" href=\"http://localhost:8082/procardio.web/faces/JSFfiles/RecomandationPage.jsp\">Recomandation</a></li>";
					if(currentUser.getAuthorization().equals("admin")) {
					administration = "<li><a  href=\"http://localhost:8082/procardio.web/faces/JSFfiles/Dashboard.jsp\">Administration</a></li>";
					}
				}%>
				<%=start_page%>
				<%=recomandation%>
				<%=administration%>
			</ul> 
			</ul> 
		</div>
	</div>
   </div>
       <div class="container-fluid">
        
        <div class="row-fluid">
            <div class="span3">
                <div class="sidebar-nav">
                  <div class="nav-header" data-toggle="collapse" data-target="#dashboard-menu"><i class="icon-dashboard"></i>Dashboard</div>
                    <ul id="dashboard-menu" class="nav nav-list collapse in">
                        <li><a href="Dashboard.jsp">Dashboard Home</a></li>
                        <%if(currentUser.getAuthorization().equals("admin")) {%>
                        <li ><a href="UsersPage.jsp">Users</a></li>
                        <li ><a href="#" onclick="changeToEmployeePage(&quot;0,first&quot;)">Employee</a></li>
                        <%} %>
                    </ul>
            </div>
        </div>
  </body>
 </html>
 </f:view>